import requests
def get_header():
    global token_en  # 设置 token_en变量为全局变量
    url_login = 'http://ihrm-java.itheima.net/api/sys/login'  # 登录接口
    json_data = {"mobile": "13800000002", "password": "123456"}  # 登录用户数据
    res = requests.post(url=url_login, json=json_data)  # 执行脚本
    token_en = 'Bearer ' + res.json()['data']  # 拼接字符串 ，构造token
    header = {"Content-Type":"application/json","Authorization":token_en}
    return header